Python models in Epicenter
Python 3 is the default version for Python models in Epicenter.
To develop your model, use an IDE like PyCharm or VS Code. The debugging capabilities of an IDE are very helpful as you fine-tune your model.
Most Python simulations require a custom-built app constructed with the Epicenter JS libraries.
Directory structure
The variables and operations that you will access through the JS libraries should be defined in a single Python file in the top-level directory as a best practice. Auxiliary functionality can be placed in other Python files in sub-directories.
For example, you could have a /business-logic sub-directory to hold all the business logic of your model's operations.
Your model's top-level directory should also contain a CTX2 context file for the model.
Testing your model
A good practice is to have a /test sub-directory, containing unit tests for the model that you can run locally and debug. Your unit tests should contain asserts to validate variable values. It's a good idea to run the tests often and ensure they all pass.